<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title>配置条件列</title>
    <link href="/bower_components/bootstrap/css/bootstrap.css" rel="stylesheet">
    <link href="/static/css/controls.css" rel="stylesheet"/>
    <link href="/static/css/engine.css" rel="stylesheet">
    <script>
        var ctx = '';
    </script>
    <script src="/bower_components/requirejs/require.js" data-main="/static/app.js"
            data-bootstrap-modules="'system2/decision/CellConditionModule'"></script>
</head>
<body ng-cloak ng-controller="CellConditionController">
<div class="engine-tab-content">
    <div id="shadeCondition"></div>
    <div class="engine-tab-content-l" style="top:0px;">
        <div class="bc">
            <button type="button" class="engine-btn-success" ng-click="save()"><i class="icon-engine-preservation"></i>保存</button>
        </div>
        <div class="clear"></div>
        <div class="entry" id="condition" >
            <div class="entry-title-l">进入条件</div>
            <div class="add"><a href="javascript:void(0)" ng-click="addConditionRow()"><i class="icon-engine-plus"></i></a></div>
            <div class="clear"></div>
            <div ng-repeat="conditionRow in conditionRows">
                <div class="entry-set"  name="rowC" id="remove{{conditionRow._id}}"    ng-if="$index==0">
                    <div class="nub">{{$index+1}}</div>
                    <div class='entry-set-l' name='rowVariable'   id="addRow{{condition._id}}">
                        <span class='attribute' ng-repeat="condition in conditionRow.conditions"  id='click{{condition.countCondition}}'  onmouseleave="closeEdit('node')"  onmouseenter="showEdit('node')"><a href='javascript:void(0)' name='node'  id='node{{condition.countCondition}}'  ng-click="show(condition.countCondition,'node',condition.type)" type={{condition.type}} value={{condition.value}}>{{condition.mes}}</a></span>
                        <span ng-if="conditionRow.isButton=='show'" id='click{{conditionRow.countCondition}}' ><button type='button' name ='addButton' id='showCondition{{conditionRow.countCondition}}' ng-click='show(conditionRow.countCondition,&apos;button&apos;)' class='engine-btn-default'>点击选择</button></span>
                        <span ng-if="conditionRow.isButton=='hidden'" id='click{{conditionRow.countCondition}}' ></span>
                    </div>
                    <div class='entry-set-r'>
                        <span><a href ng-click="addBracket()" value={{conditionRow._id}}>()</a></span>
                        <span><a href  ng-click="removeRowCondition($index)">&nbsp;-</a></span>
                    </div>
                    <div class='clear'></div>
                </div>
                <div class='entry-set' name='rowC' id='remove{{conditionRow._id}}' ng-if="$index!=0">
                    <div class="nub">{{$index+1}}</div>
                    <div class='entry-set-l' name='rowVariable' id='addRow{{conditionRow._id}}'>
                                <span  class='also'>
                                    <a ng-if="conditionRow.sign=='&&'" href='javascript:void(0)' ng-click="change(conditionRow.countCondition)" name='node'  id='symbol{{conditionRow.countCondition}}' value='{&apos;oper&apos;:&apos;&&&apos;}'>并且<i class='icon-engine-down-a'></i></a>
                                    <a ng-if="conditionRow.sign=='||'" href='javascript:void(0)' ng-click="change(conditionRow.countCondition)" name='node'  id='symbol{{conditionRow.countCondition}}' value='{&apos;oper&apos;:&apos;||&apos;}'>或者<i class='icon-engine-down-a'></i></a>
                                </span>
                        <span class='attribute' ng-repeat="condition in conditionRow.conditions"  id='click{{condition.countCondition}}'  onmouseleave="closeEdit('node')"  onmouseenter="showEdit('node')"><a href='javascript:void(0)' name='node'  id='node{{condition.countCondition}}'  ng-click="show(condition.countCondition,'node',condition.type)" type={{condition.type}} value={{condition.value}}>{{condition.mes}}</a></span>
                        <span ng-if="conditionRow.isButton" id='click{{conditionRow.countCondition}}' ><button type='button' name ='addButton' id='showCondition{{conditionRow.countCondition}}' ng-click='show(conditionRow.countCondition,&apos;button&apos;)' class='engine-btn-default'>点击选择</button></span>
                    </div>
                    <div class='entry-set-r'>
                        <span><a href ng-click="addBracket()" value={{conditionRow._id}}>()</a></span>
                        <span><a href  ng-click="removeRowCondition($index)">&nbsp;-</a></span>
                    </div>
                    <div class='clear'></div>
                </div>
            </div>
        </div>
    </div>
    <div class="engine-tab-content-r" style="top:0px;" id="shadeModel">
        <div ng-show="showNone">
            <div class="remind-r">
                <div class="tu"><i class="icon-engine-remind"></i></div>
                <div class="text">请单击条件选择框进行编辑。</div>
                <div class="clear"></div>
            </div>
        </div>
        <div ng-show="showAllCondition">
            <div class="engine-condition">
                <ul>
                    <li class="on" name="column" id="property"><a href="javascript:void(0)" ng-click="show('property')">模型</a></li>
                    <li name="column" id="entry"><a href="javascript:void(0)" ng-click="show('entry')">输入值</a></li>
                    <li name="column" id="sign"><a href="javascript:void(0)" ng-click="show('sign')">符号</a></li>
                    <li name="column" id="variable"><a href="javascript:void(0)" ng-click="show('variable')">变量</a></li>
                    <li name="column" id="method"><a href="javascript:void(0)" ng-click="show('method')">方法</a></li>
                </ul>
            </div>
            <div class="engine-attribute" ng-show="showProperty">
                <!--业务模型-->
                <div class="model">
                    <div class="model-l">业务模型</div>
                    <div class="model-r"><a href="#"><i class="icon-engine-search"></i></a></div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <table width="100%">
                        <tr ng-class="{'model-value':!$first}" ng-repeat="modelAttribute in modelAttributes" ng-if="modelAttribute.id != colId">
                            <td ng-if="modelAttribute.dataType!='Object'">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addModel(modelAttribute.name)">{{modelAttribute.dataType}}</button></div>
                                <div class="model-value-r">{{modelAttribute.name}}</div>
                                <div class="clear"></div>
                            </td>
                            <td ng-if="modelAttribute.dataType=='Object'">
                                <div class="model-value-l"><button type="button" class="engine-btn-model" id="{{modelAttribute.id}}" ng-click="viewObject(modelAttribute.id,1)">对象[+]</button></div>
                                <div class="model-value-r">{{modelAttribute.name}}</div>
                                <div class="clear"></div>
                                <div id="son{{modelAttribute.id}}" ></div>
                            </td>
                        </tr>
                    </table>
                </div>

            </div>

            <div class="engine-attribute" ng-show="showEntry">
                <div class="value">
                    <div class="engine-form-group">
                        <label>输入值</label>
                        <textarea cols="47" rows="10" ng-model="textEntry"></textarea>
                    </div>
                    <button type="button" class="engine-btn-default" ng-click="addEntry()">确定</button>
                </div>
            </div>

            <div class="engine-attribute" ng-show="showMethod">
                <!--输入值-->
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('addHours')">确定</button></div>
                    <div class="model-value-r">加 &nbsp;<input type="text" id = "addHours" style="width: 20px"/>&nbsp; 小时</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('lastDateTime','当天最后时间')">确定</button></div>
                    <div class="model-value-r">当天最后时间</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addMethod('nowDate','当前时间')">确定</button></div>
                    <div class="model-value-r">当天开始时间</div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l">
                        <button type="button" class="engine-btn-model" ng-click="addMethod('endsWith')">确定
                        </button>
                    </div>
                    <div class="model-value-r">以 &nbsp;<input type="text" id="endsWith" style="width: 40px" />&nbsp;
                        结尾
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l">
                        <button type="button" class="engine-btn-model" ng-click="addMethod('matchWith')">确定
                        </button>
                    </div>
                    <div class="model-value-r">包含 &nbsp;<input type="text" id="matchWith" style="width: 40px" />&nbsp;
                    </div>
                    <div class="clear"></div>
                </div>
                <div class="model-value">
                    <div class="model-value-l">
                        <button type="button" class="engine-btn-model" ng-click="addMethod('startWith')">确定
                        </button>
                    </div>
                    <div class="model-value-r">以 &nbsp;<input type="text" id="startWith" style="width: 40px" />&nbsp;开头
                    </div>
                    <div class="clear"></div>
                </div>
                <!--输入值结束-->
            </div>

            <div class="engine-attribute" ng-show="showVariable">
                <div class="model-value">
                    <table width="100%">
                        <tr ng-repeat="variable in variables">
                            <td>
                                <div class="model-value-l"><button type="button" class="engine-btn-model" ng-click="addVariable(variable.varName)">变量</button></div>
                                <div class="model-value-r">{{variable.varName}}</div>
                                <div class="clear"></div>
                            </td>
                        </tr>
                    </table>
                </div>
            </div>

            <div class="engine-attribute" ng-show="showSign">
                <!--符号-->
                <div class="symbol">
                    <!--<div class="symbol-tit">逻辑运算符</div>
                    <div class="symbol-but">
                        <button type="button" ng-click="addSign('&&')"  class="engine-btn-symbol">并且</button>
                        <button type="button" ng-click="addSign('||')" class="engine-btn-symbol">或者√</button>
                    </div>-->
                    <div class="symbol-tit">比较符</div>
                    <div class="symbol-but">
                        <button type="button" ng-click="addSign('<')" class="engine-btn-symbol">小于</button>
                        <button type="button" ng-click="addSign('==')" class="engine-btn-symbol">等于</button>
                        <button type="button" ng-click="addSign('>')" class="engine-btn-symbol">大于</button>
                        <button type="button" ng-click="addSign('<=')" class="engine-btn-symbol">小于等于</button>
                        <button type="button" ng-click="addSign('!=')" class="engine-btn-symbol">不等于</button>
                        <button type="button" ng-click="addSign('>=')" class="engine-btn-symbol">大于等于</button>
                    </div>
                    <div class="symbol-tit">数值运算符</div>
                    <div class="symbol-but">
                        <button type="button"  ng-click="addSign('+')" class="engine-btn-symbol">+</button>
                        <button type="button"  ng-click="addSign('-')"class="engine-btn-symbol">-</button>
                        <button type="button" ng-click="addSign('*')" class="engine-btn-symbol">*</button>
                        <button type="button"  ng-click="addSign('/')" class="engine-btn-symbol">/</button>
                    </div>
                    <div class="symbol-tit">数值运算符</div>
                    <div class="symbol-but">
                        <button type="button" ng-click="addSign('(')" class="engine-btn-symbol">(</button>
                        <button type="button" ng-click="addSign(')')" class="engine-btn-symbol">)</button>

                    </div>
                </div>
                <!--符号结束-->
            </div>
            <div class="clear"></div>
        </div>
    </div>
</div>
</body>
</html>